package com.guit.demo.client.dynamic;

import com.google.inject.Inject;

import com.guit.demo.client.dynamic.DynamicPresenter.DynamicBinder;
import com.guit.demo.client.main.MainPresenter;
import com.guit.junit.GuitTest;

import static junit.framework.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class TestDynamicPresenter extends GuitTest {

  @Inject
  DynamicPresenter presenter;

  @Override
  protected void configure() {
    mock(DynamicBinder.class);
    mock(MainPresenter.class);
  }

  @Override
  @Before
  public void setUp() {
    super.setUp();
    presenter.go(null);
  }

  @Test
  public void testDelete() {
    presenter.$click("Button number 1");
    presenter.$click("Button number 2");
    assertEquals(presenter.list.size(), 8);
  }

  @Test
  public void testReset() {
    presenter.reset();
    assertEquals(presenter.list.size(), 10);
  }
}
